package com.woniu.until;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseData<T> {
    private int code;
    private String msg;
    private T data;

    public ResponseData ok(){
        return  new ResponseData(200,"ok",null);
    }
    public ResponseData ok(T t){
        return  new ResponseData(200,"ok",t);
    }

    public ResponseData fail(){
        return  new ResponseData(2000,"fail",null);
    }

    public ResponseData noAuth(){
        return  new ResponseData(2001,"noAuth",null);
    }

    public ResponseData noLogin(){
        return  new ResponseData(2002,"noLogin",null);
    }
}
